package org.de.maeyer.unit;

/**
 * @author Peter De Maeyer
 */
public class SuffixingUnit extends NonMultiplyingUnit {

	private final String namePrefix;

	private final String symbolSuffix;

	private final Unit suffixedUnit;

	public SuffixingUnit(String namePrefix, String symbolSuffix, Unit suffixedUnit) {
		this.suffixedUnit = suffixedUnit;
		this.namePrefix = namePrefix;
		this.symbolSuffix = symbolSuffix;
	}

	@Override
	public String getName() {
		return new StringBuilder(15).append(namePrefix).append(suffixedUnit.getName()).toString();
	}

	@Override
	public String getSymbol() {
		return new StringBuilder(3).append(suffixedUnit.getSymbol()).append(symbolSuffix).toString();
	}
}
